home *** CD-ROM | disk | FTP | other *** search
/ El Mac 1 / Magazine.iso / EL MAC 1 / Shareware / Graphics / AVX Video Sampler / AVX Video Sampler.dxr / 00002_patch.ls < prev    next >
Encoding:
Text File  |  1995-09-27  |  1.1 KB  |  42 lines

  1. property startpt, endpt, movieSprite, looptype
  2.  
  3. on birth me, myStart, myEnd, myLoop
  4.   set movieSprite to 10
  5.   set startpt to myStart
  6.   set endpt to myEnd
  7.   set looptype to myLoop
  8.   return me
  9. end
  10.  
  11. on playPatch me
  12.   global currentRate
  13.   set the movieTime of sprite movieSprite to startpt
  14.   if looptype = 0 then
  15.     set the movieRate of sprite movieSprite to 0
  16.   else
  17.     set the movieRate of sprite movieSprite to 1
  18.   end if
  19.   updateStage()
  20.   set currentRate to the movieRate of sprite movieSprite
  21. end
  22.  
  23. on checkLoop me
  24.   global currentRate
  25.   if looptype = 1 then
  26.     if the movieTime of sprite movieSprite >= endpt then
  27.       set the movieTime of sprite movieSprite to startpt
  28.       set the movieRate of sprite movieSprite to abs(currentRate)
  29.     end if
  30.   else
  31.     if looptype = -1 then
  32.       if the movieTime of sprite movieSprite >= endpt then
  33.         set the movieRate of sprite movieSprite to -1 * abs(currentRate)
  34.       else
  35.         if the movieTime of sprite movieSprite <= startpt then
  36.           set the movieRate of sprite movieSprite to abs(currentRate)
  37.         end if
  38.       end if
  39.     end if
  40.   end if
  41. end
  42.